package com.itheima.propertiesIO;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class properttiesDemo02 {
    public static void main(String[] args) throws IOException {
        Properties prop=new Properties();
        //read(prop);
        prop.put("撒野","辰");
        prop.put("魔道","蓝羡");
        prop.put("天官","花怜");
        FileWriter fw=new FileWriter("prop.properties");
        prop.store(fw,"haha");
        fw.close();
    }

    private static void read(Properties prop) throws IOException {
        FileReader fr=new FileReader("prop.properties");
        prop.load(fr);
        fr.close();
        System.out.println(prop);
    }
}
